import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;

/**
 * @author user
 *
 */
public class TestPassager {
	
	Passager p1;
	Passager p2;

	/**
	 * @throws java.lang.Exception
	 */
	@Before
	public void setUp() throws Exception {
		p1 = new Passager("maugard", "matthieu");
		p2 = new Passager("paeta", "suzy");
	}

	/**
	 * Test method for {@link Passager#getName()}.
	 */
	@Test
	public void testGetName() {
		assertEquals("maugard", p1.getName());
	}

	/**
	 * Test method for {@link Passager#setName(java.lang.String)}.
	 */
	@Test
	public void testSetName() {
		p2.setName("smith");
		assertEquals("smith", p2.getName());
	}

	/**
	 * Test method for {@link Passager#getSurname()}.
	 */
	@Test
	public void testGetSurname() {
		assertEquals("suzy", p2.getSurname());
	}

	/**
	 * Test method for {@link Passager#setSurname(java.lang.String)}.
	 */
	@Test
	public void testSetSurname() {
		p2.setSurname("toto");
		assertEquals("toto", p2.getSurname());
	}
	
    /**
     * 
     */
    @Test(expected=NullPointerException.class)
    public void testNullPointerException() {
    	Passager p3 = new Passager(null, "toto");
    	Passager p4 = new Passager("tata", null);
    	p1.setName(null);
    	p2.setSurname(null);
    }

}
